<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/template.xhtml">
	<ui:define name="content">

		<p>
			<h:outputFormat value="#{rolebundle.sayfa_aciklama}" />
		</p>

		<p:panel header="#{rolebundle.giris_panel_header}"
			id="bilgiGirisPanel" styleClass="marginTop15">
			<h:outputScript library="js" name="document_ready.js" />
			<p:panelGrid columns="2" styleClass="zebra"
				columnClasses="confirmCol1,confirmCol2">
				<h:outputText value="#{rolebundle.lbl_ad}*" />
				<p:inputText value="#{roleBean.ad}" styleClass="inputW" />
				<h:outputText value="#{rolebundle.lbl_durum}" />
				<p:selectOneRadio value="#{roleBean.durum}" styleClass="ignoreZebra">
					<f:selectItem itemLabel="#{appbundle.lbl_aktif}"
						itemValue="#{true}" />
					<f:selectItem itemLabel="#{appbundle.lbl_pasif}"
						itemValue="#{false}" />
				</p:selectOneRadio>
			</p:panelGrid>
		</p:panel>
		<p>
			<h:outputFormat value="#{appbundle.zorunlu_alan_aciklama}" />
		</p>

		<h:panelGroup id="buttonsPanel">
			<div class="btnRightCol marginTop7">
				<p:commandButton value="#{appbundle.btn_iptal}"
					action="#{roleBean.cancelAction()}"
					update=":bodyForm:bilgiGirisPanel" styleClass="btn100" />
				<p:commandButton value="#{appbundle.btn_tamam}"
					action="#{roleBean.saveAction()}" update="@form"
					styleClass="btn100" />
			</div>
		</h:panelGroup>

		<p:panel id="datalistPanel" header="#{rolebundle.data_table_header}"
			styleClass="marginTop15" rendered="#{roleBean.list.size() > 0}">
			<p:dataTable var="role" value="#{roleBean.list}"
				paginator="#{roleBean.list.size() > 10}" paginatorPosition="bottom"
				rows="10">

				<p:column headerText="#{rolebundle.lbl_ad}">
					<h:outputText value="#{role.ad}" />
				</p:column>
				<p:column headerText="#{rolebundle.lbl_durum}"
					style="width:100px;text-align:center;">
					<p:selectBooleanCheckbox value="#{role.durum}" disabled="true" />
				</p:column>
				<p:column style="width:25px;text-align: center">
					<p:commandLink action="#{roleBean.updateAction()}"
						update=":bodyForm:bilgiGirisPanel">
						<p:graphicImage value="/resources/images/icons/pencil.png" />
						<f:setPropertyActionListener value="#{role}"
							target="#{roleBean.selectedRole}" />
					</p:commandLink>
				</p:column>
				<p:column style="width:25px;text-align: center">
					<p:commandLink action="#{roleBean.deleteAction()}" update="@form">
						<p:graphicImage value="/resources/images/icons/cross.png" />
						<f:setPropertyActionListener value="#{role}"
							target="#{roleBean.selectedRole}" />
					</p:commandLink>
				</p:column>
			</p:dataTable>
		</p:panel>
	</ui:define>
</ui:composition>
</html>
